# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-teamcity-messages
pkgver=1.32
pkgrel=2
pkgdesc="Send test results to TeamCity continuous integration server from unittest, nose, py.test, twisted trial, behave"
url="https://github.com/JetBrains/teamcity-messages"
license=('Apache')
arch=('any')
depends=('python')
makedepends=('python-setuptools')
checkdepends=('python-pytest' 'python-virtualenv')
source=("https://github.com/JetBrains/teamcity-messages/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('b9733edb1e2aef4ca69773070e927a2b6162b34d8bea4b4fd22c5d7858de2d6416dcc39102aa718b4858635900519cfd7e02016143ac6a19fa82d1fd6780c0a3')

prepare() {
  cd teamcity-messages-$pkgver
  sed -i "s/virtualenv_version = 'virtualenv==20.7.2'/virtualenv_version = 'virtualenv'/" setup.py
}

build() {
  cd teamcity-messages-$pkgver
  python setup.py build
}

check() {
  cd teamcity-messages-$pkgver
  python setup.py test || echo "Tests failed"
}

package() {
  cd teamcity-messages-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
}
